#ifndef PLAYER_H
#define PLAYER_H

#include <QObject>
#include "units/game.h"
#include <QtNetwork>
#include "server/clientsocket.h"

//#include "handlers/sessionhandler.h"

class Player : public QObject
{
    Q_OBJECT
public:
    Player(quint32 id,
           quint32 sessID,
           QString Account,
           QString Character,
           ClientSocket* socket,
           quint16 Level,quint64 char_type,
           QObject *parent = 0);

    bool InGame(){ return (_game==NULL ? false : true); }
    Game* getGame(){ return _game; }
    quint32 getID(){ return _ID; }
    QString getChar(){ return _Character; }
    QString getAcc() { return _Account; }
    quint32 getSessID(){ return _sessID; }
    quint16 getUDPort(){ return _udpport;}

    void setGame(Game* g){ _game=g; }
    void setID(quint32 id){ _ID =id; }
    void setUDPort(quint16 port){ _udpport = port; }
    void setChar(quint64 chart){ _char_type=chart; }
    void setCharName(QString chart){ _Character=chart; }
    void setLvL(quint16 lvl){ _Level=lvl; }

    ClientSocket* GetSkt(){ return _Socket; }
signals:
    
public slots:

private:
     quint32 _ID;
     QString _Account;
     QString _Character;
     int _socketDescriptor;
     quint16 _Level;
     quint64 _char_type;
     quint32 _sessID;
     Game* _game;
     quint16 _udpport;
     ClientSocket *_Socket;
};

#endif // PLAYER_H
